<template>
  <div class="newColor">
    <lotteryHeader></lotteryHeader>
    <div class="newColorCon scrollBar" :class="{noScroll:isStop}">
      <keep-alive>
        <router-view></router-view>
      </keep-alive>
      <div class="stopScaleBox" v-if="isStop&&$route.name != 'theColor'">
        <img class="absmiddle" :src="stopImg" alt="">
      </div>
    </div>
    <homeFooter class="footerFixed"></homeFooter>
  </div>
</template>

<script>
  import './main.scss';
  import lotteryHeader from '../../components/lotteryColor/header/index';
  import homeFooter from '../../components/footer/index';
  import {mapState} from 'vuex';
  export default {
    data() {
      return {
        isStop:false,
        stopImg:require('../../assets/images/theColor/header/stopImg.png'),
      }
    },
    mounted() {
      let that = this;
      $(window).resize(function () {
        that.calculationVal();
      })
    },
    computed: {
      ...mapState({
        recordColorData: state => state.mutations.recordColorData,
      })
    },
    activated() {
      this.calculationVal();
    },
    deactivated() {
    },
    methods: {
      init(){},
      calculationVal() {
        let height = $(window).height();
        $('.newColorCon').height(height - 71-68+10);
      }
    },
    components: {
      lotteryHeader,
      homeFooter,
    },
    watch: {
      'recordColorData': {
        handler: function (val) {
          //获取公告数据
          let colorData = JSON.parse(JSON.stringify(this.recordColorData[parseInt(this.$route.query.code)].data||{}));
          this.colorTheData = JSON.parse(JSON.stringify(this.recordColorData[parseInt(this.$route.query.code)].data.noticeList||[{  }]));
          $('.colorOfContent').scrollTop(0);
          this.isStop = colorData.status=='2'?true:false;
        },
        deep: true
      },
    }
  }
</script>
<style lang="css" rel="styleheet/css" scoped>

</style>